import request from '@/utils/request';

// 常量
const api_name = '/pms/category'

export default {
    getCategoryList() {
        return request({
            url: `${api_name}/list`,
            method: 'get'
        })
    },
    getCategoryPage(params) {
        return request({
            url: `${api_name}/list`,
            method: 'get',
            params: params
        })
    },
    getCategoryDetailsById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    saveCategory(data) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: data
        })
    },
    updateCategory(data) {
        return request({
            url: `${api_name}`,
            method: 'put',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/${ids}`,
            method: 'delete'
        })
    }
}
